]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st: Adjust theme test
authorFlorian Müllner <fmuellner@gnome.org>
Sun, 25 Aug 2019 13:57:11 +0000 (16:57 +0300)
committerFlorian Müllner <fmuellner@gnome.org>
Tue, 27 Aug 2019 12:30:51 +0000 (15:30 +0300)
Mutter's Clutter fork can no longer be initialized separatedly, as
its backend now draws from MetaBackend. Adjust the code to use the
newly added test initialization function instead to get the test
back up.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/691

src/st/meson.build
src/st/test-theme.c

index 1097a54c85e30b51265877af0cb89814e66d07cd..764ff0db48c0d350f5832118224740f88f4ae62b 100644 (file)
@@ -136,7 +136,7 @@ libst_dep = declare_dependency(link_with: libst,
 test_theme = executable('test-theme',
   sources: 'test-theme.c',
   c_args: st_cflags,
-  dependencies: [clutter_dep, gtk_dep],
+  dependencies: [mutter_dep, gtk_dep],
   build_rpath: mutter_typelibdir,
   link_with: libst
 )
index 0d6acd1357198c89e5b7fc642ad972e919444e4e..bd422da0067ecb9dfb5e3e4eafedbd0f5ae671da 100644 (file)
@@ -25,6 +25,7 @@
 #include "st-button.h"
 #include <math.h>
 #include <string.h>
+#include <meta/main.h>
 
 static ClutterActor *stage;
 static StThemeNode *root;
@@ -536,11 +537,16 @@ main (int argc, char **argv)
   StThemeContext *context;
   PangoFontDescription *font_desc;
   GFile *file;
+  g_autofree char *cwd = NULL;
 
   gtk_init (&argc, &argv);
 
-  if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
-    return 1;
+  /* meta_init() cds to $HOME */
+  cwd = g_get_current_dir ();
+
+  meta_test_init ();
+
+  chdir (cwd);
 
   /* Make sure our assumptions about resolution are correct */
   g_object_set (clutter_settings_get_default (), "font-dpi", -1, NULL);